unit ORM.Types;

interface

uses
  ORM.Types.Base, System.Generics.Collections, System.Generics.Defaults, ORM.Types.CNPJ_CPF, ORM.Types.ID,
  ORM.Types.Date, ORM.Types.CEP, ORM.Types.Money, ORM.Types.InscEstadual, ORM.Types.Fone;

type
  TypeClass = TTipo<TClass>;
  TypeObject = TTipo<TObject>;
  TypeInteger = TTipo<Integer>;
  TypeSmallInt = TTipo<SmallInt>;
  TypeBoolean = TTipo<Boolean>;
  TypeDouble = TTipo<Double>;
  TypeCurrency = TTipo<Currency>;
  TypeString = TTipo<string>;
  TypeWideString = TTipo<WideString>;
  TypeShortString = TTipo<ShortString>;
  TypeChar = TTipo<Char>;

  TypeCNPJ_CPF = TCNPJ_CPF;
  TypeMoney = TMoney;
  TypeFone = TFone;
  TypeCEP = TCEP;
  TypeDateTime = TData;
  TypeInscEstadual = TInscEstadual;
  TypeId = TId;



type
  TComparer<T> = class (TInterfacedObject, IComparer<T>)
  public
    function Compare(const Left, Right: T): Integer;
end;

type
  TObjectList<T : class> = class(TList<T>)
  private
    FOwnsObjects : Boolean;
  public
    property OwnsObjects: Boolean read FOwnsObjects write FOwnsObjects;
    constructor Create(pOwnsObjects: Boolean = True); overload;
  end;

implementation

{ TObjectList<T> }

constructor TObjectList<T>.Create(pOwnsObjects: Boolean);
begin
  inherited Create;
  FOwnsObjects := pOwnsObjects;
end;

{ TComparer<T> }

function TComparer<T>.Compare(const Left, Right: T): Integer;
begin
  Result := 0;
end;

end.
